home *** CD-ROM | disk | FTP | other *** search
/ AppleScript - The Beta Release / AppleScript - The Beta Release.iso / Documentation / develop / Apple Event Objects and You / Apple Event Objects (code) / Prototypes.h < prev    next >
Encoding:
Text File  |  1992-04-08  |  8.9 KB  |  143 lines  |  [TEXT/KAHL]

  1. /* File: Prototypes.h */
  2.  
  3.  
  4. /* AppleEventHandlers.c */
  5.         char     *OSTypeToPStr(OSType, char *);
  6.  
  7.         void     InstallAppleEventHandlers(void);
  8. pascal     OSErr    NotHandled (AEDescList *aevt, AEDescList *reply, long refCon);
  9. pascal     OSErr     HandleOapp (AEDescList *aevt, AEDescList *reply, long refCon);
  10. pascal     OSErr     HandleQuit (AEDescList *aevt, AEDescList *reply, long refCon);
  11. pascal     OSErr     HandleOdoc (AEDescList *aevt, AEDescList *reply, long refCon);
  12. pascal     OSErr     HandlePdoc (AEDescList *aevt, AEDescList *reply, long refCon);
  13.  
  14. /* ErrorHandlers.c */
  15.         void    Assert(Boolean condition, char *message, char *location, Boolean isFatal);
  16.         Boolean AssertOK(Boolean condition, char *message, char *location);
  17.         void    CheckPointer(void *p, char *ptrName, char *location);
  18.         void    CheckHandle(void *h, char *handleName, char *location);
  19.         void    CheckResult(short code, char *location);
  20.         void    Error(char *errorMsg, char *location);
  21.         Boolean IsValidPointer(void *p);
  22.         Boolean IsValidHandle(void *h);
  23.         void    ShowMessageAndDie(char *message);
  24.         void    ShowMessage(char *message);
  25.  
  26. /* Interaction.c */
  27.         OSErr     MyInteractWithUser(Boolean isUrgent);
  28.  
  29. /* ==== misc (need to split) === */
  30.         void     ae_do_Quit (void);
  31.         void     ae_do_Close (void);
  32.         void     ae_do_Open (FSSpec *theFileSpec);
  33.         void     ae_do_NewDocument (void);
  34.  
  35.         void     InvalidateWindow(WindowPtr whichWindow);
  36.         void    EntryAdded (WindowPtr whichWindow, short entryNum);
  37.         void    EntryRemoved (WindowPtr whichWindow, short entryNum);
  38.         OSErr    NewScrapbookFile(FSSpec *theFile, Boolean *cancelled);
  39.         void     GoToEntry (WindowPtr whichWindow, short entryNum);
  40.         void     SetItemEnable (MenuHandle theMenu, short theItem, Boolean enabled);
  41.         void     EnableFileCommands (void);
  42.         void     AdjustMenus(void);
  43.         void     SetScrollMaxima (WindowPtr wp, wiHand info, Boolean setToZero);
  44.         void     SetControlPositions (WindowPtr wp, wiHand info);
  45.         OSErr     NewDisplayWindow (const FSSpec *);
  46.         void     CloseAWindow (WindowPtr whichWindow);
  47.         void     DoAppleCmds (short theItem);
  48.         void     DoFileCmds (short theItem);
  49.         void     DoScrapbookCmds (short theItem);
  50.         void     Dispatch (long menuResult);
  51.         void    Init_all(void);
  52.         void     DoKey (EventRecord *theEvent);
  53.         void     DoUpdate (WindowPtr wp);
  54.         void     DoActivate (WindowPtr wp, Boolean activate);
  55.         void     DoContentClick (WindowPtr whichWindow, Point globalPt);
  56.         void     DoMouseDown (EventRecord *theEvent);
  57.         void     MainLoop(void);
  58.         void     Shutdown(void);
  59.         void     main(void);
  60.  
  61. /* string_util.c */
  62.         void    PstringToText(const char *pstring, Handle *textBlock);
  63.         void    CstringToText(const char *cstring, Handle *textBlock);
  64.         void    TextToPstring(const Handle textBlock, char *pstring);
  65.         void    TextToCstring(const Handle textBlock, char *cstring);
  66.  
  67. /* ScrapTools.c */
  68.         OSErr     _EntryToScrapIndex(short entryNum, short *scrapIndex, short *resID);
  69.         OSErr     _Get1ScrapItem(short, OSType, AEDesc *);
  70.         OSErr     CountScrapbookEntries(short *count);
  71.         OSErr     Get1ScrapbookItem (short index, OSType itemType, AEDesc *item);
  72.         OSErr     Put1ScrapbookItem (short entryIndex, const AEDescList *itemContents);
  73.         OSErr    InsertScrapbookEntry (short entryNum, const AEDescList *itemList);
  74.         OSErr     _Delete1ScrapItem(short resID, OSType itemType);
  75.         OSErr     Delete1ScrapbookItem (short entryIndex, OSType itemType, Boolean *entryRemoved);
  76.         OSErr     AdjustScrapbookEntries(short startValue, Boolean adjustUpwards);
  77.         OSErr     ZeroScrapbookIndex(short smapIndex);
  78.         OSErr    GetBestType(short entryNum, ResType *bestType);
  79.         OSErr    GetAllTypes(short entryNum, short *numTypes, ResType *typeList);
  80.  
  81.  
  82. /* cApplication.c */
  83.         OSErr App_AE_Dispatcher(const AppleEvent *message, AppleEvent *reply, long refCon, AEEventClass classID, AEEventID eventID, const AEDesc *ospec, const AEDesc *token);
  84. pascal    OSErr PropertyFromNullAccessor ( DescType desiredClass, const AEDesc *container, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *returnedToken, long refCon );
  85.         OSErr App_ReadTokenData(const AEDesc *theToken, AEDesc *tokenContents);
  86.         OSErr App_WriteTokenData(const AEDesc *theToken, const AEDesc *data);
  87.         OSErr App_GetData(AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  88.         OSErr App_SetData(AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  89.         OSErr App_InstallCallbacks( void );
  90.  
  91.  
  92. /* cEntry.c */
  93. pascal    OSErr     EntryFromDocumentAccessor(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, long LongInt);
  94. pascal    OSErr     PropertyFromEntryAccessor ( DescType desiredClass, const AEDesc *container, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *returnedToken, long refCon );
  95.         OSErr     Entry_ConvertAbsKey(const AEDesc *keyData, long *index, Boolean *getAll);
  96.         OSErr     Entry_ReadTokenData(const AEDesc *theToken, AEDesc *tokenContents);
  97.         OSErr     Entry_WriteTokenData(const AEDesc *theToken, const AEDesc *data);
  98.         OSErr     Entry_DeleteTokenData(const AEDesc *theToken);
  99.         OSErr     Entry_InsertTokenData(const AERecord *insertionLoc, const AEDescList *data, short *newElementNumber);
  100.         OSErr     Entry_GetData (AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  101.         OSErr     Entry_SetData (AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  102.         OSErr     Entry_CreateElement (AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  103.         OSErr     Entry_DeleteElement (AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  104.         OSErr     Entry_AE_Dispatcher(const AppleEvent *message, AppleEvent *reply, long refCon, AEEventClass classID, AEEventID eventID, const AEDesc *ospec, const AEDesc *token);
  105.  
  106.  
  107. /* cScrapItem.c */
  108. pascal    OSErr ItemFromEntryAccessor(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, long LongInt);
  109. pascal    OSErr     PropertyFromItemAccessor ( DescType desiredClass, const AEDesc *container, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *returnedToken, long refCon );
  110.         OSErr     Item_ConvertAbsKey(const AEDesc *keyData, long *index, Boolean *getAll);
  111.         OSErr     Item_ReadTokenData(const AEDesc *theToken, AEDesc *tokenContents);
  112.         OSErr     Item_WriteTokenData(const AEDesc *theToken, const AEDesc *data);
  113.         OSErr     Item_DeleteTokenData(const AEDesc *theToken);
  114.         OSErr     Item_InsertTokenData(const AERecord *insertionLoc, const AEDescList *data, ResType *newTypeCode);
  115.         OSErr     Item_GetData (AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  116.         OSErr     Item_SetData (AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  117.         OSErr     Item_CreateElement (AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  118.         OSErr     Item_DeleteElement (AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  119.         OSErr     Item_AE_Dispatcher(const AppleEvent *message, AppleEvent *reply, long refCon, AEEventClass classID, AEEventID eventID, const AEDesc *ospec, const AEDesc *token);
  120.  
  121. /* cWindow.c */
  122.         OSErr     Win_InstallCallbacks( void );
  123. pascal    OSErr     WindowFromNullAccessor(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, long LongInt);
  124. pascal    OSErr     PropertyFromWindowAccessor ( DescType desiredClass, const AEDesc *container, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *returnedToken, long refCon );
  125.         long     CountWindows(void);
  126.         long     GetWindowIndex(WindowPtr theWindow);
  127.         WindowPtr FindIndexedWindow(long index);
  128.         OSErr     Win_ConvertAbsKey(const AEDesc *keyData, long *index, Boolean *getAll);
  129.         void     BuildWindowToken(const WindowPtr theWindow, DescType desiredClass, long index, AEDesc *theToken);
  130.         OSErr     Win_CreateElement(const AppleEvent *message, AppleEvent *reply, DescType insertionPos, AEDesc *token, AEDesc *replyObject);
  131.         OSErr     Win_Close(AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  132.         OSErr     Win_GetData(AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  133.         OSErr     Win_SetData(AppleEvent *message, AppleEvent *reply, long refcon, AEDesc *token, AEDesc *replyObject);
  134.         OSErr     Win_AE_Dispatcher(const AppleEvent *message, AppleEvent *reply, long refCon, AEEventClass classID, AEEventID eventID, const AEDesc *ospec, const AEDesc *token);
  135.         OSErr     Win_ReadTokenData(const AEDesc *theToken, AEDesc *tokenContents);
  136.         OSErr     Win_WriteTokenData(const AEDesc *theToken, const AEDesc *data);
  137.  
  138. /*  File: ObjectDispatch.proto.h */
  139.         OSErr     SendAEToObject (    const AppleEvent *message, AppleEvent *reply, long refCon, AEEventClass classID, AEEventID eventID, DescType dispatchClass, const AEDesc *ospec, const AEDesc *token);
  140. pascal     OSErr     DirectParamDispatch(AppleEvent *message, AppleEvent *reply, long refcon);
  141. pascal     OSErr     CreateElementDispatch(AppleEvent *message, AppleEvent *reply, long refcon);
  142.  
  143.